import os
import django
from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Library_WEB.settings')
django.setup()
celery_app = Celery('stocksys')
celery_app.config_from_object('django.conf:settings')
celery_app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

from stocksys import tasks
@celery_app.task(bind=True ,name='debug_task')
def debug_task(self):
    print('Request: {0!r}'.format(self.request))